package com.base.study04_collection;

import java.util.ArrayDeque;
import java.util.LinkedList;

/**
 * ClassName: DequeDemo
 * PackageName: com.cwy.study04_collection
 * Describe:
 *
 * @author: Cheng Wenying
 * @Create: 2024/1/16
 * @version:
 */
public class DequeDemo {
    public static void main(String[] args) {
        ArrayDeque<String> objects = new ArrayDeque<>();

        //添加元素
        objects.add("add");
        objects.add("小明");
        objects.add("好好");

        objects.removeLast();
        objects.remove();

        System.out.println(objects);

        LinkedList<Object> queue = new LinkedList<>();

        queue.offer("aaa");
        queue.offer("bbb");
        queue.offer("ccc");

        System.out.println(queue.get(2));
        queue.poll();
        System.out.println(queue);
    }
}
